import home from './components/home/home.jsx';

/* 登入模块 */
import singin from './pages/singin/singin.jsx';

/* 订单管理模块 */
import orderManagement from './pages/order_management/order_management.jsx';
  // 订单列表页面
import orderList from './pages/order_management/order_list/order_list.jsx';
  // 订单详情页面
import orderDetails from './pages/order_management/order_details/order_details.jsx';

/* 人员管理模块 */
import personnelManagement from './pages/personnel_management/personnel_management.jsx';
  // 销售列表页面
import personneList from './pages/personnel_management/personnel_list/personnel_list.jsx';

/* 单号分配模块 */
import orderAllocation from './pages/order_allocation/order_allocation.jsx';
  // 分配列表页面
import allocationList from './pages/order_allocation/allocation_list/allocation_list.jsx';

/* 产品管理模块 */
import productManagement from './pages/product_management/product_management.jsx';
  // 产品列表
import productList from './pages/product_management/product_list/product_list.jsx';


import './style/style.scss';

const Router = ReactRouter.Router;
const hashHistory = ReactRouter.hashHistory;
// const browserHistory = ReactRouter.browserHistory;
const Route = ReactRouter.Route;
const IndexRoute = ReactRouter.IndexRoute;

ReactDOM.render(
  <Router history={hashHistory}>
    <Route path="/"  component={singin}/>
    <Route path="/home" component={home}>
      <Route path="/orderManagement" component={orderManagement}>
        <IndexRoute component={orderList}/>
        <Route path="orderDetails/:ID" component={orderDetails}/>
      </Route>
      <Route path="/personnelManagement" component={personnelManagement}>
        <IndexRoute component={personneList}/>
      </Route>
      <Route path="/orderAllocation" component={orderAllocation}>
        <IndexRoute component={allocationList}/>
      </Route>
      <Route path="/productManagement" component={productManagement}>
        <IndexRoute component={productList}/>
      </Route>
    </Route>
  </Router>,
  document.getElementById('App')
);
